
#include <stdio.h>
#include <stdlib.h>
#include "list.h"


struct list * listDodajNaKoniec(struct list *lista, int key)
{
    struct list * nowy = ( struct list *)malloc(sizeof(struct list));
    struct list * cur = lista;
    //printf("Dodaje: %d", key);
    nowy->key=key;
    nowy->next=0;
    if(!cur)
    {
        lista=nowy;
    }
    else
    {
            while(cur->next)
                cur=cur->next;
            cur->next=nowy;
    }
    return lista;
}
